<?php
class AddVip extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		$me = check_login ( ADMIN_LOGIN_PAGE );
		$data = sess_del ( 'vip_form_info', array ('status' => 'actived' ) );
		$data ['vip'] = $data;
		
		$gM = new CoreGroupModel ();
		$groups = $gM->where ( array ('type' => 'vip' ) )->select ();
		$data ['groups'] = $groups;		
		if ($groups) {
			$data ['group_options'] = $groups->toArray ( 'gname', 'name', array ('' => '请选择会员组' ) );
		} else {
			$data ['group_options'] = array ('' => '请选择会员组' );
		}
		$data ['error'] = sess_del ( 'vip_form_error', array () );
		$data ['error_cls'] = ModelValidator::getErrorCls ( $data ['error'] );
		$data ['page_tip_info'] = sess_del ( 'page_tip_info' );		
		return new SmartyView ( $data, 'vip/AddVip' );
	}
}